public class MyMean extends Share {
	static String HOME = "../resgod/Mean";

	public static void main(String[] args) {
		checkArgs(args);
		initialize(HOME);

		if (bUserID == 0) {
			header();
		}

		long time = System.currentTimeMillis();
		loop();
		System.out.println("Time: " + (System.currentTimeMillis() - time));

		pw.close();
	}

	static void header() {
		println("uMean,iMean,label");
	}

	static void loop() {
		for (; bUserID < bStop; bUserID++) {
			int v = 0;

			for (int bItemID : USERB[bUserID].items) {
				userMean(bUserID);
				itemMean(bItemID);
				v++;
			}
		}
	}

	static void userMean(int bUserID) {
		User aUser = USERA[bUserID];

		double aUserSum = 0;
		for (byte vote : aUser.votes) {
			aUserSum += vote;
		}
		print(aUserSum / aUser.ilen);
	}

	static void itemMean(int bItemID) {
		Item aItem = ITEMA[bItemID];

		double aItemSum = 0;
		for (byte vote : aItem.votes) {
			aItemSum += vote;
		}
		println(aItemSum / aItem.ulen);
	}
}
